<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<img src="../imgs/off.gif" id="imgs">


<script>
    function on() {
        document.getElementById("imgs").src="../imgs/on.gif";
    }
    function off() {
        document.getElementById("imgs").src="../imgs/off.gif";
    }



    var count = 0;
    window.setInterval(function () {
        if (count % 2 == 0){
            on();
        }else {
            off();
        }
        count++;
    },1000)
</script>
</body>
</html>